'use strict'
const Koa=require('Koa')
const cors=require('koa-cors')
const bodyParser=require('koa-bodyparser')
const routerMiddleware=require('./router/index')

let app=new Koa()


app.use(cors())   //任何人来访问都没有跨域问题
app.use(bodyParser())
app.use(routerMiddleware())


let port =3000;
app.listen(port);
console.log(`服务器运行在如下地址：http://localhost:${port}`);